package com.sc.nft.feign;

import com.sc.nft.dto.IdRequest;
import com.sc.nft.req.profittemplate.ProfitTemplateGetProfitAndPointsReq;
import com.sc.nft.req.profittemplate.profitTemplateItemPageReq;
import com.sc.nft.req.profittemplate.profitTemplatePageReq;
import com.sc.nft.req.profittemplate.profitTemplateReq;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import com.sc.nft.vo.profittemplate.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @author JYT
 * @create 2024/4/27 11:29
 */
@FeignClient(name = "meta-mall-mini-app", path = "/wxMiniMall/profitTemplate")
public interface WxMiniProfitTemplateClient {

    /**
     * 新增小程序分佣模版
     * @param request
     * @return
     */
    @PostMapping(value = "/create", produces = MediaType.APPLICATION_JSON_VALUE)
    Result saveProfitTemplate(@RequestBody profitTemplateReq request);

    /**
     * 更新小程序分佣模版
     * @return
     */
    @PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
    Result updateProfitTemplate(@RequestBody profitTemplateReq request);

    /**
     * 启用小程序分佣模版
     * @param request
     * @return
     */
    @PostMapping(value = "/enable", produces = MediaType.APPLICATION_JSON_VALUE)
    Result enable(@RequestBody IdRequest request);

    /**
     * 关闭小程序分佣模版
     * @param request
     * @return
     */
    @PostMapping(value = "/disable", produces = MediaType.APPLICATION_JSON_VALUE)
    Result disable(@RequestBody IdRequest request);

    /**
     * 小程序分佣模版详情
     * @param request
     * @return
     */
    @PostMapping(value = "/details", produces = MediaType.APPLICATION_JSON_VALUE)
    Result<profitTemplateVO> details(@RequestBody IdRequest request);


    /**
     * 小程序分佣模版绑定的商品
     * @param request
     * @return
     */
    @PostMapping(value = "/getGoods", produces = MediaType.APPLICATION_JSON_VALUE)
    List<profitTemplateItemPageVO> getGoods(@RequestBody profitTemplateItemPageReq request);


    /**
     * 分佣模版列表
     * @param request
     * @return
     */
    @PostMapping(value = "/adminPage", produces = MediaType.APPLICATION_JSON_VALUE)
    PageResult<profitTemplatePageVO> adminPage(@RequestBody profitTemplatePageReq request);

    /**
     * 用户端分销专区
     * @param request
     * @return
     */
    @PostMapping(value = "/webGoods", produces = MediaType.APPLICATION_JSON_VALUE)
    PageResult<ProfitTemplateWebGoodsPageVO> webGoods(@RequestBody ProfitTemplateWebGoodsPageReq request);


    /**
     * 根据金额获取利润
     * @param request
     * @return
     */
    @PostMapping(value = "/getProfitAndPoints", produces = MediaType.APPLICATION_JSON_VALUE)
    ProfitTemplateGetProfitAndPointsVO getProfitAndPoints(@RequestBody ProfitTemplateGetProfitAndPointsReq request);
    /**
     * 判断商品是否在分销专区
     * @param idReq
     * @return
     */
    @PostMapping(value = "/checkGoodsBind", produces = MediaType.APPLICATION_JSON_VALUE)
    Boolean checkGoodsBind(@RequestBody IdRequest idReq);
}
